{include file="header.tpl"}
<div class="container">
    <div class="wrapper">
        <div id="st-accordion" class="st-accordion">
            <ul>
                <form method="POST">
                    <li class="st-open" style="height: auto;">
                        <a href="#">Create Transaction<span class="st-arrow">Open or Close</span></a>
                        <div class="st-content">
                            {if !empty($errors)}
                                <ul class="form-errors">
                                    {foreach from=$errors key=k item=error}
                                    <li>{$k}
                                        <ul class="errors">
                                            <li>{$error}</li>
                                        </ul>
                                    </li>
                                    {/foreach}
                                </ul>
                            {/if}
                                <p>
                                    <label for="code">管理番号</label>
                                    <input name="code" id="code" value="{$code}"/>
                                    <button class='button-success pure-button' type="submit" name="search" value="1">検索</button>
                                </p>
                            {if (empty($errors) && $search) || !empty($submit)}
                                {if $contract}
                                    <p>物件名 : {$contract.house_name}</p>
                                    <p>号室 : {$contract.room_number}</p>
                                    <p>退去者 : {$contract.client_name}</p>
                                    <p>連絡先 : {$contract.client_phone}</p>
                                    <p>保証会社 : {$contract.guarantee_company_name}</p>
                                    <p>解約日 : {$contract.contract_cancel_date}</p>
                                {else}
                                    <p>No data found</p>
                                {/if}
                            {/if}
                        </div>
                    </li>
                    {if (empty($errors) && $search && $contract) || !empty($submit)}
                        <li class="st-open" style="height: auto;">
                            <div class="st-content">
                                {if !empty($repair_users)}
                                    <p>
                                        <label for="repair_id">立会内装業者</label>
                                        <select name="repair_id" id="repair_id" title="cty sửa chữa phòng">
                                            <option value="0">  </option>
                                            {foreach from=$repair_users key=k item=u}
                                                <option value="{$u.id}" {if $repair_id eq $u.id} selected = "selected" {/if}>{$u.user_lname} {$u.user_fname}</option>
                                            {/foreach}
                                        </select>
                                    </p>
                                {/if}
                                {if !empty($contents)}
                                    <p>
                                        <label for="content_id">内容</label>
                                        <select name="content_id" id="content_id">
                                            <option value="0">  </option>
                                            {foreach from=$contents key=k item=c}
                                                <option value="{$c.id}" {if $content_id eq $c.id} selected = "selected" {/if}>{$c.name}</option>
                                            {/foreach}
                                        </select>
                                    </p>
                                {/if}
                                <p>
                                    <input type="hidden" name="contract_code" value="{$code}"/>
                                    <button class='button-success pure-button' type="submit" name="submit" value="1"> 送信 </button>
                                </p>
                            </div>
                        </li>
                    {/if}
                </form>
            </ul>
        </div>
    </div>
</div>
<link rel="stylesheet" type="text/css" href="{$url->url_base}include/css/demo.css" />
<link href='http://fonts.googleapis.com/css?family=Josefin+Slab:400,700' rel='stylesheet' type='text/css' />
{include file="footer.tpl"}